$(function () {
    $.messager.model = {
        ok: {text: "确定", classed: 'btn-primary'},
        cancel: {text: "取消", classed: 'btn-danger'}
    };

    $('.btn-delete').click(function () {
        var url = $(this).data('url');
        var id = $(this).data('id');
        $.messager.confirm('温馨提示', '确定要删除吗？', function () {
            $.get(url,{id:id},function (data) {
                if(data.success){
                    $.messager.confirm('温馨提示', data.msg, function () {
                        window.location.reload();
                    });
                }else{
                    $.messager.alert('温馨提示', data.msg);
                }
            });
        });
    });

})